package com.rec.smile.controller;

import java.util.Date;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rec.smile.bo.User;

@RestController
@SpringBootApplication
@ServletComponentScan(basePackages=  {"com.rec.smile.filter,com.rec.smile.servlet"})
public class ThisWillActuallyRun {

	@RequestMapping("/")
	public String home(){
		return "hello world";
	}
	
	@RequestMapping("/find")
	//@ResponseBody
	public User findUser(){
		User user = new User();
		user.setId(1000);
		user.setName("aaa");
		user.setPhone("111111111111111111");
		user.setBirthday(new Date());
		return user;
	}
	
	//@RequestMapping("/error")
	public int exec(){
		return 1100/0;
	}
	
	
	public static void main(String[] args) {
		SpringApplication application = new SpringApplication(ThisWillActuallyRun.class);
		/*
         * Banner.Mode.OFF:关闭;
         * Banner.Mode.CONSOLE:控制台输出，默认方式;
         * Banner.Mode.LOG:日志输出方式;
         */
		//application.setBannerMode(Banner.Mode.OFF);
		application.run(args);
	}
}
